import Vue from 'vue'

// normalize.css：抹平浏览器差异   normalize.css
import 'normalize.css/normalize.css' // A modern alternative to CSS resets

// vant  移动端        ElementUI==>vue   vue3  + ts       ant-design==>react  hooks
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
// import locale from 'element-ui/lib/locale/lang/en' // lang i18n

import '@/styles/index.scss' // global css   less   scss

import App from './App'
import store from './store'
import router from './router'

import '@/icons' // icon
import '@/permission' // permission control
import '@/directives'

/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online ! ! !
 */
// process.env.NODE_ENV:获取当前的环境，development:开发环境  production:生产环境
// 生产环境使用mock
// if (process.env.NODE_ENV === 'production') {
//   const { mockXHR } = require('../mock')
//   mockXHR()
// }

// set ElementUI lang to EN
// Vue.use(ElementUI, { locale })
// 如果想要中文版 element-ui，按如下方式声明

/*
全局组件注册
  1：main.js
    Vue.component('组件名',导入的组件)

*/
import Print from 'vue-print-nb'
Vue.use(Print)

// mixin全局处理
import Mixinjs from '@/mixins/index'
Vue.mixin(Mixinjs)

import componentJs from '@/components/lib'
import i18n from '@/lang'
Vue.use(componentJs, 123) // 插件注册

// Vue.use(ElementUI)
Vue.use(ElementUI, {
  i18n: (key, value) => i18n.t(key, value)
})
Vue.prototype.$bus = new Vue()
Vue.config.productionTip = false

new Vue({
  el: '#app',
  data() {
    return {
      appVal: '我是app组件'
    }
  },
  i18n,
  router,
  store,
  render: (h) => h(App)
})
